<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en" ng-app="loginApp">
<head>        
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />    
    <title>Login - Aries Premium Admin Template</title>
    <link rel="stylesheet" type="text/css" href="/Public/css/login.css">
<link rel="stylesheet" type="text/css" href="/Public/css/index.css"/>
<link rel="stylesheet" type="text/css" href="/Public/css/nav.css"/>
<link rel="stylesheet" type="text/css" href="/Public/css/base.css"/>
<link rel="stylesheet" type="text/css" href="/Public/bootstrap/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="/Public/Font-Awesome-3.2.1/css/font-awesome.min.css"/>	   
</head>
<body ng-controller="loginForm" style=" background: #FAFAFA;">   
    <header>
<div class="nav-box">
	<div class="nav-nav">
		<div class="nav-nav-left">
			<a href=""><img class="logo" src="/Public/css/logo.svg" style="height: 47px;line-height: 47px; width: 90px; padding-left: 0.5em;float: left;"></a>
			<a href="/index.php/Home/share/index" class="item">分享</a>
			<!-- <a href="" class="item">帮助</a>
			<a href="" class="item">建议</a> -->
			<a href="javascript:;" class="finder_box">
					<div class="finder_input">
						<input type="text" class="finder" placeholder="搜索文件"/>	
					</div>
					<div class="finder_btn">
							<i class="icon-search"></i> 
					</div>
			</a>
		</div>
		<div class="nav-nav-right">
			<a href="">
					<img class="logo" src="/Public/css/524316_hlcxxx.png" style="width: 40px;float: right;border-radius: 50%;margin-top:5px;">
			</a>
<!-- 			<a href="" class="item"><i class="icon-signout"></i></a>
			<a href="" class="item"><i class="icon-envelope"></i></a> -->
			<a href="/index.php/Home/share/index" class="item"><i class="icon-user"></i></a>
			<a href="/index.php/Home/UploadFile/index?#" class="item"><i class="icon-plus"></i></a>
		</div>
	</div>
</div>
</header> 
    <div class="container " style="margin-top:80px;">
        <div class="row">
            <div class="col-md-12" style="text-align:center">
                    <h4><i class="icon-user"></i>&nbsp;用户登录</h4>
            </div>  
        </div>  
        <div class="row">
            <div class="col-md-offset-4 col-md-4 login-box" style="">
        <form role="form"  ng-submit="httpPost()">
        <div class="form-group">
            <label for="username">用户名</label>
            <input type="text" class="form-control" name="login"  ng-model="regData.username" placeholder="login"/>
        </div>
        <div class="form-group">
            <label for="password">密码</label>
            <input type="text" class="form-control" name="password" ng-model="regData.password"  placeholder="password"/>
        </div>  
      <!--   <div class="checkbox">
            <label>
                <input type="checkbox"  ng-model="regData.keeponline.on"/> keep online 
            </label>
        </div>  -->
<button type="submit" class="btn btn-primary  btn-block">Sign in</button>
<br>
<button class="btn  btn-warning btn-block"  type="button" ng-click="gotoreg()" >Register</button>
                </div>    
            </div>
        </div>
    </form>  
            </div>
        </div>
    </div> 
    
    
    </div>
    
</body>
<script src="/Public/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/Public/layer/layer.js" type="text/javascript" charset="utf-8"></script>
<script src="/Public/js/angular.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">

	var app = angular.module('loginApp',[]); //声明module
		app.controller('loginForm',function($scope,$http){ //声明控制器
			$scope.regData = {};
			$scope.httpPost = function(){
					  $http.post('<?php echo U('login');?>', $scope.regData)
				        .success(function(data) {
                            console.log(data);
				        	if(data.code == 0){
				        		layer.msg(data.msg,function(){
				        			location.href = data.url;
				        		});
				        	}else{
				        		layer.msg(data.msg);
				        	}
				           
				        });
			};
			$scope.gotoreg = function(){
				window.location.href = '<?php echo U('reg');?>';
			}
		});
		
		
	
</script>
</html>